import Vue from 'vue'
import axios from 'axios'
import qs from 'qs'

// axios的get请求
export function get(url,data = {}){
	return new Promise((resolve,reject) => {
		axios({
			url:url,
			method:'GET',
			params:data
		}).then(res => {
			resolve(res.data)
		}).catch(res => {
			reject(res.data)
		})
	})
}

// axios的post请求
export function post(url,data = {}){
	return new Promise((resolve,reject) => {
		axios({
			url:url,
			method:'POST',
			params:data
		}).then(res => {
			resolve(res.data)
		}).catch(res => {
			reject(res.data)
		})
	})
}